/**
 * User: alesj
 * Date: 2005.3.11
 * Time: 14:51:31
 * 
 * (C) Genera Lynx d.o.o.
 */

package com.generalynx.ecos.data.types;

public abstract class IntPersistentEnum implements PersistentEnum {

    protected abstract Integer toIntegerCode();

    public Object toSwitchCode() {
        return toIntegerCode();
    }

    public boolean equals(Object obj) {
        if (obj == null || !(obj instanceof IntPersistentEnum)) return false;
        IntPersistentEnum ipe = (IntPersistentEnum)obj;
        return toIntegerCode().equals(ipe.toIntegerCode());
    }

}
